//
//  MTVerticalButton.m
//  MeToo
//
//  Created by 俊松何 on 2018/7/3.
//  Copyright © 2018年 tianxie. All rights reserved.
//

#import "MTVerticalButton.h"

@implementation MTVerticalButton
-(void)steup
{
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
    self.layer.cornerRadius = 5;
    self.layer.masksToBounds = YES;
}

-(instancetype)initWithFrame:(CGRect)frame
{
    if(self = [super initWithFrame:frame])
    {
        [self steup];

        self.imageView.contentMode =  UIViewContentModeScaleAspectFill;
    }
    return self;
}

-(void)awakeFromNib
{
    [super awakeFromNib];
    [self steup];
}

-(void)layoutSubviews
{
    [super layoutSubviews];
    self.imageView.x = 0;
    self.imageView.y = 0;
    self.imageView.width  = self.width;
    self.imageView.height = self.imageView.width;
    
    self.titleLabel.x = 0;
    self.titleLabel.y = self.imageView.height ;
    self.titleLabel.width  = self.width;
    self.titleLabel.height = self.height - self.titleLabel.y;
//    [self.titleLabel setFont:[UIFont systemFontOfSize:13]];
}

@end
